package com.wonders.hisdoctor.station.util;

import com.baomidou.mybatisplus.annotation.DbType;
import com.wonders.his.framework.utils.MybatisPlusGeneratorUtil;
import com.wonders.his.framework.vo.DataSourceConfigDTO;
import com.wonders.his.framework.vo.PackageConfigDTO;
import org.junit.Test;

/**
 * @author: tyang
 * date: 2020/12/19 23:46
 * @description: aa
 */
public class MybatisPlusGenerator {

    @Test
    public void MybatisPlusGeneratorTest() {
        //数据库地址端口号服务名,账号,密码,数据库驱动,数据库类型
        DataSourceConfigDTO dataSourceConfigDTO = new DataSourceConfigDTO("jdbc:oracle:thin:@10.1.94.197:1521:hispro", "comm", "comm_2020#123",
                "oracle.jdbc.OracleDriver", DbType.ORACLE);
        //实体类包名,mapper包名,service包名,controller包名
        PackageConfigDTO packageConfigDTO = new PackageConfigDTO("domain", "mapper", "service", "controller");
        //packageName:生成到哪个文件夹下,xmlResporcePath:xml生成地址,要生成的表名称
        new MybatisPlusGeneratorUtil().generateCode(dataSourceConfigDTO, packageConfigDTO,
                "com.wonders.his.charge.project.base",
                "/src/main/resources/mapper/base/", new String[]{"TESTYJH"});
    }

}
